﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using CSA.Lib;

namespace CSA.OptimalMonitoringNetwork
{
    public partial class OMNOutputConfigUI : CSCustomUI
    {
        CSOMNProblem m_Problem;

        public override CSAlgorithmSettings AlgorithmSettings
        {
            get
            {
                return base.AlgorithmSettings;
            }
            set
            {
                base.AlgorithmSettings = value;
                txtResult.DataBindings.Clear();
                if (AlgorithmSettings == null)
                {
                    m_Problem = null;
                    txtResult.Text = "";
                    return;
                }
                m_Problem =(CSOMNProblem) AlgorithmSettings.SpatialOptimizationProblem;
                if (m_Problem != null)
                {
                    txtResult.DataBindings.Clear();
                    txtResult.DataBindings.Add("Text", m_Problem, "OptimalLocationsFile");
                }                
            }
        }

        public CSOMNProblem ProblemInfo
        {
            get { return m_Problem; }          
        }
        public OMNOutputConfigUI()
        {
            InitializeComponent();
            txtMemo.Text = TextString.OutputDes;
        }      

        private void btnSelectCityFile_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();
            dlg.Filter = "ESRI ShapeFile|*.shp";
            dlg.Title = "Save";         
            DialogResult re = dlg.ShowDialog();
            if (re == System.Windows.Forms.DialogResult.OK)
            {
                txtResult.Text = dlg.FileName;
                txtResult.Focus();
            }
        }
  
        private void CustomEncodeUI_Load(object sender, EventArgs e)
        {
         
        }



    }
}
